package com.dyb.recuitment.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dyb.recuitment.entity.Area;
import com.dyb.recuitment.mapper.AreaMapper;
import com.dyb.recuitment.service.IAreaService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 区域表（国省市区） 服务实现类
 * </p>
 *
 * @author 邓宇斌
 * @since 2022-02-22
 */
@Service
public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IAreaService {

    @Autowired
    private AreaMapper areaMapper;

    @Override
    public List<Area> selectByArea(Area area) {
        QueryWrapper<Area> queryWrapper = new QueryWrapper<>(area);
        return areaMapper.selectList(queryWrapper);
    }

    @Override
    public List<Area> selectCity() {
        return areaMapper.selectCity();
    }

    @Override
    public List<Area> selectAllArea() {
        return areaMapper.selectList(new QueryWrapper<>());
    }

}
